import { createStore } from 'vuex'
// 2.0 创建仓库 new Vuex.Store({}) 数据持久化模块
import cart from './modules/cart'
import user from './modules/user'
import category from './modules/category'
import createPersistedState from 'vuex-persistedstate'

export default createStore({
  modules: {
    cart,
    user,
    category
  },
  // 持久化插件
  plugins: [createPersistedState({
    // 需要存储的模块
    paths: ['user', 'cart']
  })]

})
